$(function () {
});
var managerlogin = function () {
    var username = $("#username").val();
    if (username == null) {
        alert("用户名不能为空！");
        return;
    }
    var password = $("#password").val();
    if(password == ""){
        alert("密码不能为空！");
        return;
    }
    var param = {
        "name": username,
        "password": password
    }
    $.ajax({
        type: "post",
        contentType: 'application/json',
        url: "http://localhost:3333/manager/login",
        data: JSON.stringify(param),
        dataType: "json",
        success: function onSucc(data) {
            alert("1111");
            alert(data.code);
            if (data.code == "0000") {
                window.location.href = "hello.html";
            } else {
                window.location.href = "error.html";
            }
        },
        error: function onErr() {
            alert("登陆请求失败！");
        }
    });

}





